<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  <style type="text/css">
    .highlight { display: block; background-color: #ddd; }
  </style>
  <script type="text/javascript">
    function highlight() {
      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
    }
  </script>
</head>
<body onload="prettyPrint(); highlight();">
  <pre class="prettyprint lang-js">&lt;?php
<span id='global-property-'>/**
</span> * Cube PHP Framework
 * 
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the &quot;License&quot;); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 * 
 * @author Dillen / Steffen
 */

namespace Library\Mvc;

<span id='Library-Mvc-Layout'>/**
</span> * The layout manager.
 * 
 * @class Library.Mvc.Layout
 * @extends {Library.Mvc.View}
 * @abstract
 */
class Layout extends View
{
<span id='Library-Mvc-Layout-property-String'>	/**
</span>	 * Which layout is used, the total path will
	 * be %application_path% / layouts / %layout_file%
	 * 
	 * @property String _layoutFile
	 * @var string
	 * @private
	 */
	private $_layoutFile = 'default';
	
<span id='Library-Mvc-Layout-method-renderView'>	/**
</span>	 * Render the current view, the total path will
	 * be %application_path% / views / %controller% / %action% /
	 * 
	 * @method renderView
	 */
	public function renderView()
	{
		$path = $this-&gt;request-&gt;controller . '/' . $this-&gt;request-&gt;action . '.phtml';
		$this-&gt;render($path);
	}
	
<span id='Library-Mvc-Layout-method-setLayout'>	/**
</span>	 * Set the current layout to another one.
	 * Default layout is: 'default'
	 * 
	 * @param String layout
	 * @method setLayout
	 */
	public function setLayout($layout)
	{
		$this-&gt;_layoutFile = $layout;
	}
	
<span id='Library-Mvc-Layout-method-renderLayout'>	/**
</span>	 * Render layout
	 * 
	 * @method renderLayout
	 */
	public function renderLayout()
	{
		$this-&gt;render($this-&gt;_layoutFile . '.phtml', array(), 'layouts');
	}
}
</pre>
</body>
</html>
